
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Bootstrap Admin</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <% include ../includePage/refResource.html %>
    <link rel="stylesheet" href="/styles/lib/kindeditor/themes/default/default.css" />
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
<!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
<!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<body class="">
<!--<![endif]-->

<% include ../includePage/header.html %>

<% include ../includePage/navigation.html %>

<div class="content">
    <div class="articleContent">
        <form class="form-horizontal" method="post" action="/article/saveArticleDetail">
            <input type="hidden" value="<%=user._id%>" name="id" id="txtId" />

            <div class="control-group">
                <label class="control-label" for="txtUserName">用户名</label>
                <div class="controls">
                    <input type="text" id="txtUserName" placeholder="用户名" value="<%=user.title%>" name="txtUserName">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="txtPassword">密  码</label>
                <div class="controls">
                    <textarea rows="3"  id="txtPassword" style="width: 650px;" placeholder="请输入密码" name="txtPassword"><%=article.summary%></textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="txtEmail">Email</label>
                <div class="controls">
                    <textarea rows="5"  id="txtEmail" placeholder=" add Email" name="txtEmail"><%=article.content%></textarea>

                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button type="submit" class="btn">save</button>
                </div>
            </div>

        </form>

    </div>
</div>
<script src="/js/lib/bootstrap/bootstrap.js"></script>
<script src="/js/lib/jqueryPlug/jquery.form.js"></script>
<script type="text/javascript">
    $(function(){

        var options = {
            beforeSubmit:  showRequest,  // pre-submit callback
            success:       showResponse  // post-submit callback

        };
        $("#formArticleType").ajaxForm(options);
        function showRequest(formData, jqForm, options) {
            var queryString = $.param(formData);
            alert(11);
            return true;
        }

        function showResponse(responseText, statusText)  {
            alert('status: ' + statusText + '\n\nresponseText: \n' + responseText);
        }

        var ajaxGetAtricleType = function () {
            var argUrl = "/article/articleTypeAll";
            jQuery.ajax({
                dataType: "json",
                type: "GET",
                contentType: "application/x-www-form-urlencoded; charset=gb2312",
                url: argUrl,
                cache: false,
                async: true,
                success: function (data) {
                    if (data) {
                        onloadAricleType(data);
                    }
                },
                error: function (ex) {


                }
            });
        }
        function onloadAricleType(objArticle){
            var articleValue ="<%=article.refArticleId%>";
            var ddlArticleType = $("#ddlArticleType");
            var optionHtml="";
            for(var i=0;i<objArticle.length;i++){
                optionHtml+="<option value='"+objArticle[i]._id+"'>"+objArticle[i].articleType+"</option>";
            }
            ddlArticleType.append(optionHtml);
            if(articleValue){
                ddlArticleType.val(articleValue);
            }

        }
        ajaxGetAtricleType();

    });


</script>

</body>
</html>


